.safe-area-container {
    position: relative; /* Change from fixed to relative */
    width: 100%;
}

.container {
    background-color: #f5f5f5;
    min-height: 100vh; /* Use min-height instead of fixed height */
    position: relative;
    overflow-y: auto; /* Allow vertical scrolling */
    padding-bottom: 100rpx; /* Add some bottom padding to ensure full scrollability */
}



.chart-container {
    background-color: white;
    border-radius: 20rpx;
    padding: 20rpx;
    margin: 20rpx;
    position: relative;
}

.chart-title {
    display: block;
    text-align: center;
    font-size: 28rpx;
    color: #666;
    margin-bottom: 20rpx;
}

.power-canvas {
    width: 100%;
    height: 400rpx;
}

/* 新增/修改的样式 */
.statistics {
    display: flex;
    justify-content: space-between;
    padding: 20rpx 10rpx;
    margin: 30rpx 10rpx;
}

.stat-card {
    flex: 1;
    background: #ffffff;
    border-radius: 24rpx;
    padding: 30rpx;
    margin: 0 15rpx;
    box-shadow: 0 8rpx 40rpx rgba(57, 117, 212, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card.today {
    background: linear-gradient(135deg, #f8f9ff, #f0f5ff);
}

.stat-card.month {
    background: linear-gradient(135deg, #f5fbff, #ebf8ff);
}

.stat-header {
    display: flex;
    align-items: center;
    margin-bottom: 30rpx;
}

.stat-icon {
    width: 80rpx;
    height: 80rpx;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20rpx;
}

.stat-icon.today-icon {
    background: rgba(57, 117, 212, 0.1);
}

.stat-icon.month-icon {
    background: rgba(16, 185, 129, 0.1);
}

.stat-icon .iconfont {
    font-size: 44rpx;
}


.stat-icon img{
    width: 100%;
    height: 100%;
}

.stat-label {
    font-size: 28rpx;
    color: #666;
    font-weight: 400;
}

.stat-value {
    font-size: 56rpx;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    margin-bottom: 20rpx;
    display: block;
}

.stat-value .unit {
    font-size: 28rpx;
    color: #999;
    margin-left: 12rpx;
    font-weight: normal;
}

.stat-footer {
    border-top: 2rpx solid #eee;
    padding-top: 20rpx;
}

.stat-trend {
    font-size: 24rpx;
    color: #666;
    display: flex;
    align-items: center;
}

.stat-card.today .stat-trend {
    color: #10b981;
}

.stat-card.month .stat-trend {
    color: #ef4444;
}

/* 添加悬浮效果（可选） */
.stat-card:active {
    transform: translateY(-4rpx);
    box-shadow: 0 12rpx 50rpx rgba(57, 117, 212, 0.15);
}

.data-tooltip {
    position: absolute;
    background-color: rgba(51, 102, 204, 0.9);
    color: white;
    border-radius: 10rpx;
    padding: 10rpx 20rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* 增加 z-index 确保在最上层 */
}

.tooltip-time {
    font-size: 24rpx;
    margin-bottom: 5rpx;
    opacity: 0.8;
}

.tooltip-value {
    font-size: 32rpx;
    font-weight: 600;
}


/*饼图*/
.device-pie-chart-container {
    background-color: white;
    border-radius: 20rpx;
    padding: 20rpx;
    margin: 20rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.device-pie-canvas {
    width: 100%;
    height: 500rpx; /* 稍微减小高度 */
    margin-bottom: 20rpx; /* 为图例腾出空间 */
}

/* 新增图例样式 */
.device-pie-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 20rpx;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5rpx 10rpx;
}

.legend-color {
    width: 16rpx;
    height: 16rpx;
    border-radius: 50%;
    margin-right: 10rpx;
}

.legend-text {
    font-size: 24rpx;
    color: #666;
}

/* 图表头部样式 */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 20rpx;
}

.chart-switch {
    color: #3975d4;
    font-size: 24rpx;
    padding: 8rpx 16rpx;
    border-radius: 8rpx;
    background: rgba(57, 117, 212, 0.1);
}

/* 柱形图画布 */
.device-bar-canvas {
    width: 100%;
    height: 500rpx;
    margin-bottom: 20rpx;
}

/* 用电量对比图 */
.power-comparison-container {
    background-color: white;
    border-radius: 20rpx;
    box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}

.power-comparison-canvas {
    width: 100%;
    height: 400rpx;
    margin-bottom: 50rpx;
}